Position sensing system

ABSTRACT

A position sensing system for measuring a position of a moving object includes a first magnetic sensor configured to measure an intensity of a magnetic field produced by the moving object. The system includes a controller configured to estimate a position of the moving object based on a nonlinear model of the magnetic field produced by the moving object as a function of position around the moving object, and based on the measured intensity of the magnetic field produced by the moving object.

CROSS-REFERENCE TO RELATED APPLICATIONS

This Utility Patent Application is a Continuation of patent application Ser. No. 14/778,491 filed Sep. 18, 2015 which is a U.S. National Stage filing under 35. U.S.C. § 371 of PCT/2014/031250, filed Mar. 19, 2014, entitled “Position Sensing System”, which claims priority under 35 U.S.C. § 119(e)(1) to U.S. Provisional Patent Application Ser. No. 61/803,268, filed Mar. 19, 2013, entitled “Position Sensing System”, and the entire teachings of which are incorporated herein by reference.

REFERENCE TO GOVERNMENT RIGHTS

The Government has an interest in the patent as a result of funding derived from U.S. DOT/RITA Grant #DTRT06-G-0013.

BACKGROUND OF THE INVENTION

Potentiometers, linear variable differential transformers (LVDTs), lasers, and LED based systems may be used for position measurement. In general, the LVDT and potentiometer type of sensors require a mechanical connection between the moving object and the sensor. Hence, it is not possible to use these sensors in a case where the moving object is isolated, such as a piston moving inside an engine. Making the mechanical connection requires modification of the design of the system, requires assembly, and can expose the sensors to a harsh environment where their performance reduces. Another limitation of these types of sensors is that the size of the sensor increases as the range of measurement increases.

Laser and LED sensors do not require mechanical connection. However, they require a clear line of sight to the moving object. Hence, their application becomes limited in cases where the moving object is optically isolated. Another requirement of the sensor is that the surface of the moving object should reflect a certain percentage of the laser beam. Laser and LEDs that provide sub-mm level accuracy are highly expensive.

Some position measurement systems that are based on magnetic fields only provide a binary measurement of position (e.g., an indication of whether the object is to the left or the right of the sensor), and do not provide a continuous measurement of position. Some position measurement systems that are based on magnetic fields require installation of an extra magnet on the moving object, and an array of magnetic sensor devices is placed adjacent to the moving object. In such a system, the required short gap (i.e., 0.5 mm to 5.5 mm) between the sensor and the moving object limits the applicability of the sensor in cases where a thicker isolation of the moving object is required. Another major drawback of such a system is that the size of the sensor increases with the increase in the range of measurement of the sensor. For example, if it is desired to measure the position of a hydraulic piston whose range of motion is 500 mm, the length of the sensor should be at least 500 mm. In some systems, the size of the magnets attached to the moving object are different based on the desired range of motion, and can be as large as 20 mm in diameter and 7 mm in thickness, limiting the placement of magnets in a moving piston in an engine or a hydraulic cylinder. Some of these systems also have poor linearity. The accuracy of magnetic sensors can be adversely affected by external magnetic objects coming close to the sensors.

SUMMARY OF THE INVENTION

One embodiment is directed to a position sensing system for measuring a position of a moving object. The system includes a first magnetic sensor configured to measure an intensity of a magnetic field produced by the moving object. The system includes a controller configured to estimate position of the moving object based on a nonlinear model of the magnetic field produced by the moving object as a function of position around the moving object, and based on the measured intensity of the magnetic field produced by the moving object.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example of magnetic field lines around a long slender magnetized ferromagnetic object with a rectangular cross-section.

FIG. 2 shows an example of a ferromagnetic sphere object magnetized in a uniform magnetic field and the magnetic field lines around it.

FIG. 3 shows a model of the magnetic field around a rectangular ferromagnetic object.

FIG. 4 shows a model of the magnetic field around a ferromagnetic object shaped like a circular disk.

FIG. 5 shows a model of the magnetic field along the longitudinal axis of a long cylindrical ferromagnetic object.

FIG. 6 shows the use of the inherent magnetic field of a free piston engine for position estimation.

FIG. 7 is a block diagram illustrating a position measurement system according to one embodiment.

FIG. 8 shows the magnetic field obtained from a magnetic sensor versus distance obtained from an LVDT sensor as a piston was moved.

FIG. 9A shows a graph of magnetic field versus piston distance.

FIG. 9B shows a graph of error versus piston distance.

FIG. 10 shows a graph of piston distance versus time for magnetic sensors and an LVDT sensor in a first experiment.

FIG. 11 shows a graph of piston distance versus time for magnetic sensors and an LVDT sensor in a second experiment.

FIG. 12 shows a graph of magnetic field versus time measured by two AMR sensors.

FIG. 13 shows a graph of piston distance versus time for the position estimates obtained by method 4 in comparison to LVDT measurements.

FIG. 14 shows a graph of model parameter estimates.

FIG. 15 shows the estimated position of a piston when the piston is moved a full stroke length after the parameter adaptation.

FIG. 16 shows the error between a Linear Variable Differential Transducer (LVDT) used as a reference and magnetic sensor estimate of piston position.

FIG. 17 shows a graph of piston distance versus time for the position estimates obtained by method 5 in comparison to LVDT measurements.

FIG. 18 shows a graph of model parameter estimates using method 5.

FIG. 19 shows a general schematic for testing vehicles in order to investigate the magnetic field generated by an encountered vehicle as a function of distance.

FIG. 20A shows a result of fitting a magnetic field equation for a vehicle to data points.

FIG. 20B shows a position estimation comparison between magnetic sensors and a sonar sensor.

FIG. 21 shows a match between experimental data and a developed model for a hydraulic cylinder application.

FIG. 22A shows a graph of magnetic field versus time when a disturbance in the magnetic field occurs.

FIG. 22B shows a graph of piston position versus time to show how existing techniques do not adjust for the disturbance in the magnetic field.

FIG. 22C shows a graph of piston position versus time to show how embodiments disclosed herein adjust for the disturbance in the magnetic field.

FIG. 23 shows a position measurement system with two magnetic sensors and a small magnet on a piston head.

FIG. 24 shows sensor readings from the system shown in FIG. 23 when a piston is moved a full stroke.

FIG. 25 shows the values of estimated parameters over iterations.

FIG. 26 shows piston position obtained from LVDT and magnetic sensors.

FIG. 27 shows the error in position estimation by the sensing system.

FIG. 28 shows piston positioned measured by LVDT and estimated from magnetic sensor when a disturbance exists.

FIG. 29 shows a magnetic sensor measurement that gets affected by an external disturbance.

FIG. 30 shows a position sensing system with a quad arrangement of four magnetic sensors for disturbance rejection.

FIG. 31 shows the magnetic field of a dipole when sensors are placed on the side of a piston.

FIG. 32 shows magnetic field readings of four magnetic sensors that get affected by an external disturbance.

FIG. 33 shows piston position measured by LVDT and estimated from magnetic sensor measurements.

FIG. 34 shows estimated disturbance on each of four magnetic sensors over time.

FIG. 35 shows the measured magnetic field readings from four sensors.

FIG. 36 shows piston position measured by LVDT and estimated from magnetic sensors measurements.

FIG. 37 shows error in position estimation over time.

FIG. 38 shows an estimated disturbance on magnetic sensors.

FIG. 39 shows a sensor configuration for disturbance rejection using three longitudinally spaced sensors.

FIG. 40 shows magnetic field readings of the sensors with a disturbance caused by an external object.

FIG. 41 shows piston position measured by LVDT and estimated from the magnetic sensors measurements.

FIG. 42 shows an error in position estimation with and without disturbance rejection.

FIG. 43 shows an estimated disturbance on each of the sensors.

DETAILED DESCRIPTION OF THE INVENTION I. Introduction

One embodiment is directed to a position sensing system and method for the non-intrusive real-time measurement of the position of a moving ferromagnetic object, such as piston position inside a cylinder. The system includes at least one magnetic sensor for measuring an intensity of a magnetic field produced by the moving object, and a processor or controller for estimating the position of the moving object based on a nonlinear model of the magnetic field produced by the object as a function of position around the object, and based on the measured intensity of the magnetic field produced by the object. With the use of more than one magnetic sensor, the parameters of the magnetic field function can be auto-calibrated or adaptively estimated.

The system according to one embodiment exploits the principle that any ferromagnetic object has an inherent magnetic field that varies as a function of position around the object. For example, cars on highways, pistons and other oscillating components in engines, pneumatic cylinders, hydraulic systems and many other moving components in machines have magnetic fields around them. By modeling the magnetic field as a function of position and using sensors to measure magnetic field intensity, the position of the object can be estimated. In one embodiment, the magnetic sensor or sensors are positioned axially along the direction of displacement. In this embodiment, the sensor or sensors are aligned with the axis of movement and sense one-dimensional position along the axis of movement. This principle is used to measure piston position in a free piston engine without requiring any sensors inside the engine cylinder. The piston is approximated as a rectangular metallic object and the variation of the magnetic field around it is modeled.

The variation of the magnetic field as a function of position is fundamentally nonlinear. A linear approximation consisting of a linear relationship between position and magnetic field will fail to be accurate, except over very short distances and short ranges. Hence, the assumption of a linear approximation without detailed modeling of magnetic field is inadequate. The use of a nonlinear model that fundamentally describes magnetic field variation with position for a ferromagnetic object of the given shape is needed for each shape.

A challenge arises from the fact that the parameters of the model would vary from one piston to another piston and would be cumbersome to calibrate for each piston. This challenge is addressed in one embodiment by utilizing two magnetic field sensors with known longitudinal separation between them. A number of estimation methods are disclosed that identify and update magnetic field parameters in real-time without requiring any additional position sensors for calibration. One such method is an iterated least squares algorithm that provides adaptive parameter estimates and accurate position estimation. Experimental results from a free piston engine set up show that the sensor can provide better than 0.4 mm accuracy in position estimates.

The same measurement system can be applied to machines that have no inherent magnetic fields by embedding a piston in such a system with a small magnet. An experimental demonstration of such a system on a pneumatic cylinder has been performed. The sensing system can be utilized for piston position measurement in multi-cylinder spark ignition (SI) and diesel engines, hydraulic cylinders, pneumatic cylinders, and in many other machines for position measurement applications.

FIG. 1 shows an example of magnetic field lines around a long slender magnetized ferromagnetic object with a rectangular cross-section. FIG. 2 shows an example of magnetic field lines around a ferromagnetic spherical object getting magnetized in a uniform magnetic field. The intensity of the magnetic field shown in these Figures varies as a function of position around the objects.

FIG. 3 shows a model of the magnetic field around a rectangular ferromagnetic object. The magnetic field around a ferromagnetic object can be modeled as a function of the geometry of the object, if it is assumed that the object is uniformly magnetized. For example, consider a rectangular metallic object as shown in FIG. 3. The magnetic field variation along the x-axis can be approximately modeled using the following Equation I:

$B_{x} \cong \frac{p}{x_{A} + e}$

where: p and e are constant parameters and x_(A) is the distance along the x-axis from the object.

FIG. 4 shows a model of the magnetic field around a ferromagnetic object shaped like a circular disk. The magnetic field around a circular disk, as shown in FIG. 4, can be modeled using the following Equation II:

$B_{x} = {p\;\frac{R^{2}}{\left( {x_{A}^{2} + R^{2}} \right)^{3/2}}}$

where: p is a constant parameter and R is the disk diameter.

FIG. 5 shows a model of the magnetic field along the longitudinal axis of a long cylindrical ferromagnetic object. The magnetic field along the longitudinal axis of a long cylinder (like the piston in an internal combustion engine), as shown in FIG. 5, can be modeled using the following Equation III:

$B_{x} = {p\left( {1 - \frac{x_{A}}{\left( {x_{A}^{2} + R^{2}} \right)^{1/2}}} \right)}$

where: x_(A) is the distance of point A from center of the disk, R is the radius of the disk, and p is a constant parameter.

For the case where the diameter of the cylinder is small compared to the distance along the longitudinal axis at which measurements are being made, the magnetic field of Equation III can be approximated by:

$B_{x} = {{p\left( {1 - \frac{x_{A}}{\left( {x_{A}^{2} + R^{2}} \right)^{\frac{1}{2}}}} \right)} = {{p\left( {1 - \frac{1}{\left( {1 + \left( \frac{R}{x_{A}} \right)^{2}} \right)^{\frac{1}{2}}}} \right)} = {{p\left( {1 - \left( {1 - {\frac{1}{2}\left( \frac{R}{x_{A}} \right)^{2}}} \right)} \right)} = \frac{p^{\prime}}{x_{A}^{2}}}}}$ $\mspace{79mu}{{{where}\text{:}\mspace{14mu} p^{\prime}} = \frac{{pR}^{2}}{2}}$

As seen from this equation, the magnetic field variation is inversely proportional to the square of the distance. Earlier, for the other shapes described in Equations I and II, the variation was inversely proportional to other powers of the distance. Thus, the magnetic field variation as a function of distance depends on the shape of the ferromagnetic object.

By measuring the magnetic field at one or more points in the neighborhood of the ferromagnetic object, and by using the model of the magnetic field as a function of position, the position of the object can be calculated very reliably with sub-mm precision. For example, consider one or more magnetic sensors located near the cylinder head of a free-piston engine as shown in FIG. 6. FIG. 6 shows the use of the inherent magnetic field of a free piston engine for position estimation. By measuring the magnetic field, B_(x), using the model given by Equation I, and by knowing the model parameters p and e, one can compute the piston position inside the cylinder.

While the magnetic field function can be obtained from analytical modeling, the parameters in the model vary from one object to another, even for objects with the same geometry. However, in one embodiment, these parameters are pre-calibrated or obtained by adaptive estimation algorithms for auto-calibration, using redundant magnetic field measurements. These parameters depend on both the size and strength of magnetization of the specific object and cannot be known a priori. In order for the sensor to be useful, it is desirable to be able to measure position without requiring cumbersome calibration for each object. This can be done by using just one additional redundant sensor for a one-dimensional position measurement application.

One embodiment consists of the following components: (1) A set of magnetic field measurement sensors, longitudinally or laterally separated with known distances between them; (2) a model of the magnetic field around the ferromagnetic object under consideration, as a function of the position around the object; (3) a method to calculate the position of the object based on measurements of the magnetic field, and based on the magnetic field as a function of position from the model; and (4) a method to adaptively estimate the parameters of the model by use of multiple longitudinally/laterally separated redundant sensors.

FIG. 7 is a block diagram illustrating a position measurement or sensing system 700 according to one embodiment. System 700 includes a matrix of magnetic sensors with known distances between the sensors 702, amplifier 706, analog to digital converter 708, interface 710, adaptive estimation controller 714, and a model of magnetic field as a function of position 712. System 700 is configured to measure the position of ferromagnetic object 704 as the object 704 moves.

In operation according to one embodiment, the matrix of magnetic sensors 702 continuously measures the magnetic field intensity at the location of the matrix 702. The measured magnetic field intensity varies as the object 704 moves. In one embodiment, the matrix 702 includes one or more magnetic field sensors in a known configuration. Magnetic sensor matrix 702 generates analog measurements based on the sensed magnetic field intensity, and outputs the analog measurements to amplifier 706, which amplifies the analog measurements. Amplifier 706 outputs the amplified analog measurements to analog to digital converter 708, which converts the amplified analog measurements to digital measurement data. Converter 708 outputs the digital measurement data to controller 714 via interface 710. In one embodiment, interface 710 is a wireless interface. In another embodiment, interface 710 is a wired interface.

Based on the received digital measurement data and the model 712, controller 714 performs an adaptive estimation method to calculate estimated model parameters 720. Using the calculated parameters 720 in the model 712, controller 714 continuously generates calculated position data 722 based on received digital measurement data. The calculated position data 722 provides a real-time indication of the current position of the object 704. In one embodiment, after calculating the estimated model parameters 720, controller 714 is also configured to periodically update these parameters 720 during normal sensing operations of the system 700.

In one embodiment, controller 714 comprises a computing system or computing device that includes at least one processor 716 and memory 718. Depending on the exact configuration and type of computing device, the memory 718 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.), or some combination of the two. The memory 718 used by controller 714 is an example of computer storage media (e.g., non-transitory computer-readable storage media storing computer-executable instructions for performing a method). Computer storage media used by controller 714 according to one embodiment includes volatile and nonvolatile, removable and non-removable media implemented in any suitable method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by controller 714.

II. Measuring Position Based on Magnetic Fields

The inherent magnetic field of a metallic object can be used to compute the position of the object. Any ferromagnetic object has an inherent magnetic field and this field varies as a function of the position around the object. If the magnetic field can be analytically obtained as a function of the position, the field intensity can be measured using sensors and then the position of the object computed from it. Embodiments disclosed herein are directed to the modeling of the magnetic field around a metallic object as a function of position and the use of this model to estimate position from magnetic field measurements.

A significant challenge for this sensing mechanism arises from the fact that the parameters in the magnetic field versus position function are unique to the particular object under consideration. While the functional form will remain the same for objects of the same shape and size, the parameters in the function can vary from one object to another due to the varying strength of magnetization.

Hence calibration of each individual object is needed which could be extremely time consuming both for instrumentation of the system with reference position calibration sensors, and for the actual data gathering and calibration process. Embodiments disclosed herein overcome this challenge by using an adaptive estimation algorithm that utilizes redundant magnetic sensors to both estimate parameters and the position.

In modern internal combustion engines with variable compression ratio, measuring the position of a piston inside the engine cylinder is becoming important for a variety of real-time combustion control technologies. This disclosure describes how the measurement system can be used for accurate estimation of the piston positions inside a free-piston engine. The same technology can be extended to many other oscillating piston applications, including conventional engine systems and electrohydraulic cylinders. In these applications, the piston position is estimated using a small external magnetic sensor located outside the cylinder. No instrumentation or assembly of sensors inside the cylinder is needed. Further, the sensor hardware is inexpensive with each magnetic sensor having a current retail cost of less than $10.

III. Free Piston Engine

A free piston engine (FPE) is one that does not have a crankshaft attached as in conventional engines. This “frees” the piston motion from being restricted by the position of the rotating crankshaft. The position of the piston instead is determined by the interaction between the combustion gas forces and the load forces acting on it. Advantages of a free piston engine include reductions in friction losses and possibilities to optimize engine operation efficiency using variable compression ratios. A free piston engine can have variable stroke length and the piston position needs to be controlled actively. This requires a precise position sensor for real-time feedback.

FIG. 6 shows a schematic of a dual piston FPE. The FPE includes an inner and an outer piston that can move towards and away from each other. Accurate estimation of the positions of the pistons is needed for synchronizing and controlling the piston motion. Currently, LVDT position sensors are used to measure piston positions. The LVDT sensors are expensive and furthermore require significant effort for assembly into the engine. LVDT sensors were utilized as described herein to verify the validity of the piston estimates obtained from the magnetic sensors.

One or more magnetic sensors are placed on one side of the FPE as shown in FIG. 6 to estimate the position of the outer piston. These magnetic sensors correspond to the matrix of magnetic sensors 702 in FIG. 7. The 3-axis HMC2003 set of anisotropic magneto-resistive (AMR) devices from Honeywell are utilized in one embodiment of the matrix of magnetic sensors 702. However, only the magnetic field readings along the “x” axis are measured and used for position estimation in one embodiment. Hence, in one form of this embodiment, a single axis AMR chip may be used for the magnetic sensor matrix 702.

In one embodiment, the AMR sensor is packaged on a Printed Circuit Board (PCB) together with a microprocessor that reads the sensor signals and transmits the values to a computer (e.g., to controller 714). A transceiver that can communicate wirelessly with a PC is included on the PCB. A USB interface instead of wireless transceiver can be utilized in order to obtain a 2 kHz sampling frequency. The transceiver or USB interface correspond to interface 710 in FIG. 7.

Very small changes in the magnetic field were observed as the piston was moved during preliminary tests. The change was of the order of 0.2 Gauss during full motion of the outer piston, from 20 mm to 60 mm away the AMR sensor. To get a better signal-to-noise-ratio the signals from the AMR sensors were amplified (e.g., by an amplifier 706, as shown in FIG. 7). The HMC2003 sensors have a nominal sensitivity of 1 V/G and since the sensor signals are being captured with a 12-bit analog-to-digital converter (i.e., converter 708 in FIG. 7) with a voltage range of 0-5 V, one count is equivalent to (5/4095) V=1.22 mV≅1.22 mG. On the other hand, the specified resolution of the AMR sensor according to the manufacturer is 40 μG. Hence, it is appropriate to amplify the output of the sensor by about 5 times to get higher signal levels without a significant deterioration in the signal-to-noise ratio. The Analog Devices AMP04 amplifier chip is utilized for amplifier 706 in one embodiment.

The main source of the generated magnetic field is considered to be the outer piston connecting mechanism, made of steel, since the body and the rest of the outer piston is made of aluminum. Also the inner piston is far away from the outer piston connecting rod, ˜170 mm at the closest distance, and its effect on the magnet field at the AMR sensor is considered to be negligible. In the following section, an analytical relation between the magnetic field created by the piston connecting mechanism and the distance from it is developed.

IV. Analytical Development of Magnetic Field Equations

The outer piston connecting mechanism has a complex shape, and it is difficult to obtain an exact analytical formula for its magnetic field. However, if the shape is approximated with a rectangular cube as shown in FIG. 3, an approximate analytical equation for the magnetic field as a function of position along the longitudinal axis X of the piston head can be obtained.

The planar components of the magnetic field generated by the element dm₀ at the point A in FIG. 3 are given by the following Equations IV and V:

$B_{r} = {\frac{\mu_{0}d\; m_{0}}{2\;\pi\; r^{3}}\cos\;\alpha}$

$B_{\alpha} = {\frac{\mu_{0}d\; m_{0}}{4\;\pi\; r^{3}}\sin\;\alpha}$

Hence, the magnetic field generated by dm₀ along the X axis would be equal to that given in the following Equations VI and VII: B _(x) =B _(r) cos α−B _(a) sin α  Equation VI

$\begin{matrix} {B_{x} = {\frac{\mu_{0}d\; m_{0}}{4\;\pi\; r^{3}}\left( {{2\;\cos^{2}\alpha} - {\sin^{2}\alpha}} \right)}} & {{Equation}\mspace{14mu}{VII}} \end{matrix}$

The magnetic field generated by the whole block can be obtained from the integral given in the following Equation VIII:

$\begin{matrix} {B_{x} = {\int_{- a}^{a}{\int_{- b}^{b}{\int_{- L}^{0}{\frac{\mu_{0}m_{0}}{4\;\pi\; r^{3}}\left( {{2\;\cos^{2}\alpha} - {\sin^{2}\alpha}} \right){dxdydz}}}}}} & {{Equation}\mspace{14mu}{VIII}} \end{matrix}$

Assuming that point A is at distance x_(A) from the surface, we can express r and a in terms of x, x_(A), y and z to obtain the following Equations IX, X, XI, and XII: r ² =y ² +z ²+(x _(A) −x)²  Equation IX

$\begin{matrix} {\alpha = {{atan}\left( {\frac{y}{y}\frac{\sqrt{y^{2} + z^{2}}}{x_{A} - x}} \right)}} & {{Equation}\mspace{14mu} X} \end{matrix}$

${\sin^{2}\alpha} = \frac{y^{2} + z^{2}}{y^{2} + z^{2} + \left( {x_{A} - x} \right)^{2}}$

${\cos^{2}\alpha} = \frac{\left( {x_{A} - x} \right)^{2}}{y^{2} + z^{2} + \left( {x_{A} - x} \right)^{2}}$

Hence, the integral in Equation VIII becomes:

$\begin{matrix} {B_{x} = {\frac{\mu_{0}m_{0}}{\pi}{\int_{0}^{a}{\int_{0}^{b}{\int_{- L}^{0}{\frac{{2\left( {x_{A} - x} \right)^{2}} - \left( {y^{2} + z^{2}} \right)}{\left( {\left( {x_{A} - x} \right)^{2} + y^{2} + z^{2}} \right)^{\frac{5}{2}}}{dxdydz}}}}}}} & {{Equation}\mspace{14mu}{XIII}} \end{matrix}$

Using MATLAB and the “int” command in the Symbolic toolbox, the result of the above integration will be:

$\begin{matrix} {B_{x} = {\frac{\mu_{0}m_{0}}{\pi}\left( {{{atan}\left( \frac{ab}{{x_{A}\left( {a^{2} + b^{2} + x_{A}^{2}} \right)}^{1/2}} \right)} - {{atan}\left( \frac{ab}{\left( {x_{A} + L} \right)\left( {a^{2} + b^{2} + \left( {x_{A} + L} \right)^{2}} \right)^{1/2}} \right)}} \right)}} & {{Equation}\mspace{14mu}{XIV}} \end{matrix}$

Equation XIV can be simplified in order to use it efficiently for position estimation. The dimensions of the head are as follows: a≅35 mm, b≅80 mm, L≅40 mm.

The values of x_(A) change from about 20 mm to 60 mm from the AMR sensor. First of all, the second term can be ignored in comparison with the first term since (x_(A)+L) is in the denominator. The connecting rods add to the effective length L and decrease the effect of the second term. Hence, Equation XIV can be simplified to the following Equation XV:

$\begin{matrix} {B_{x} \cong {\frac{\mu_{0}m_{0}}{\pi}{{atan}\left( \frac{ab}{{x_{A}\left( {a^{2} + b^{2} + x_{A}^{2}} \right)}^{1/2}} \right)}}} & {{Equation}\mspace{14mu}{XV}} \end{matrix}$

Also, the following approximation can be used since b is considerably larger than a and x_(A):

$\begin{matrix} {\frac{ab}{{x_{A}\left( {a^{2} + b^{2} + x_{A}^{2}} \right)}^{1/2}} = {\frac{a}{{x_{A}\left( {\left( \frac{a}{b} \right)^{2} + 1 + \left( \frac{x_{A}}{b} \right)^{2}} \right)}^{1/2}} \cong \frac{a}{x_{A}}}} & {{Equation}\mspace{14mu}{XVI}} \end{matrix}$

Hence, Equation XV can be simplified to the following:

$\begin{matrix} {B_{x} \cong {\frac{\mu_{0}m_{0}}{\pi}{atan}\mspace{14mu}\left( \frac{a}{x_{A}} \right)}} & {{Equation}\mspace{14mu}{XVII}} \end{matrix}$

Finally, using the approximation for the atan function given in the following Equation XVIII, the approximation given in Equation XVII can be rewritten as shown in Equation XIX:

$\begin{matrix} {\theta = {\left. {{atan}(z)}\rightarrow\theta \right. = {\frac{\pi}{4} - {\frac{\pi}{4}\frac{1 - z}{1 + z}}}}} & {{Equation}\mspace{14mu}{XVIII}} \end{matrix}$

$\begin{matrix} {{B_{x} \cong {\frac{\mu_{0}m_{0}}{\pi}\left( {\frac{\pi}{4} - {\frac{\pi}{4}\frac{1 - \frac{a}{x_{A}}}{1 + \frac{a}{x_{A}}}}} \right)}} = {{\frac{\mu_{0}m_{0}}{4}\left( {1 - \frac{x_{A} - a}{x_{A} + a}} \right)} = {\frac{\mu_{0}m_{0}a}{2}\frac{1}{x_{A} + a}}}} & {{Equation}\mspace{14mu}{XIX}} \end{matrix}$

To apply Equation XIX to the piston head, we replace a with e since the effective height of the head is less than a defined as the width of the rectangle enclosing the head. Now defining

$p = \frac{\mu_{0}m_{0}a}{2}$ we come up with the following Equation XX:

$\begin{matrix} {B_{x} \cong \frac{p}{x_{A} + e}} & {{Equation}\mspace{14mu}{XX}} \end{matrix}$

Equation XX provides a simple relation for magnetic field at a distance x_(A) from the piston head. By placing magnetic sensors at a distance from the piston head and using this relation, the outer piston position x_(p), distance from the AMR sensor can be estimated. However, since the static magnetic field at the beginning of each test is being subtracted, which also includes the field created by the outer piston at its initial position, Equation XX is rewritten as follows:

$\begin{matrix} {B_{x} = {\frac{p}{x_{p} + e} - \frac{p}{x_{p\; 0} + e}}} & {{Equation}\mspace{14mu}{XXI}} \end{matrix}$

Subtracting the initial magnetic field is done in order to remove the influence of the earth's magnetic field and other static or slowly varying magnetic fields. In order to use Equation XXI for position estimation, three parameters p, e, and x₀, should be known. However, it is not possible to estimate these three parameters from Equation XXI, even if two AMR sensors are used instead of one AMR sensor, since the system becomes unobservable for three unknown parameters. Therefore, it is assumed that x_(p0) is known. The value can be obtained from an LVDT. In case that there are no LVDTs installed, the piston can be started from a known initial position (e.g., at the lower or upper bounds of motion of the piston) for the first time, and x_(p0) can be obtained from the geometry of the piston and the location of the AMR sensor with respect to the engine. After the first run, the final position is recorded and used as the initial position for the next run.

In the following sections, the values for p and e are estimated using two different strategies: (1) using one AMR sensor and an LVDT sensor (methods 1 and 2); and (2) using two AMR sensors (method 3). The results are discussed in the following sections.

V. Parameter Estimation for Position Measurement System Using Additional LVDT Sensor

Since the FPE in one embodiment is already equipped with an LVDT, the distance obtained from the LVDT and the magnetic field measurements from the AMR sensor can be used to obtain estimates of the equation parameters. Therefore, the outer piston was moved from one end to the other end and the AMR sensor and LVDT sensor signals were captured.

FIG. 8 shows the magnetic field obtained from the AMR sensor versus distance obtained from the LVDT sensor as the piston was moved from x_(p0)≅63 mm to x_(pf)≅23 mm. Magnetic field is plotted in arbitrary voltage units, the same as what was read from the ADC of the microcontroller.

Two methods were evaluated to estimate equation parameters, which are described in the following sub-sections.

A. Method 1—Least Squares

Defining

${q = \frac{p}{x_{0} + e}},$ Equation XXI can be rewritten as follows:

$\begin{matrix} {B_{xi} = {{\frac{q\left( {x_{p\; 0} + e} \right)}{x_{p\; i} + e} - {q\left( {B_{xi} + q} \right)\left( {x_{pi} + e} \right)}} = {{{q\left( {x_{p\; 0} + e} \right)}B_{xi}x_{pi}} = {{{- B_{xi}}e} - {\left( {x_{pi} - x_{p\; 0}} \right)q}}}}} & {{Equation}\mspace{14mu}{XXII}} \end{matrix}$

All of the measurements from AMR sensor B_(xi)'s and LVDT sensor x_(pi-LVDT)'s are combined, and a Least Squares (LS) method is used to fit a curve to the data points, as shown in the following Equations XXIII-XXVI: y=H{circumflex over (X)}+v  Equation XXIII y=[B _(x1) x _(p1-LVDT) B _(x2) x _(p2-LVDT) . . . B _(x1) x _(pn-LVDT)]′  Equation XXIV

$H = \begin{bmatrix} {- B_{x\; 1}} & {- \left( {x_{{p\; 1} - {LVDT}} - x_{{p\; 0} - {LVDT}}} \right)} \\ {- B_{x\; 2}} & {- \left( {x_{{p\; 2} - {LVDT}} - x_{{p\; 0} - {LVDT}}} \right)} \\ \vdots & \vdots \\ {- B_{xn}} & {- \left( {x_{{pn} - {LVDT}} - x_{{p\; 0} - {LVDT}}} \right)} \end{bmatrix}$ {circumflex over (X)}=[ê{circumflex over (q)}]′&{circumflex over (p)}={circumflex over (q)}(x _(pO-LVDT) +ê)  Equation XXVI

The least squares solution is given in the following Equation XXVII: {circumflex over (X)}=(H′H)⁻¹ H′y  Equation XXVII

The estimated values of p and e are shown in the following Table I (Method 1):

TABLE I Summary of Parameter Values and Maximum Errors Max Error Method p e (mm) Method 1 - Least Squares −84043 24.0543 0.3294 Method 2 - Minimax −88233 25.6632 0.2731 Method 3 - AMRs only −85844 24.3881 0.4141

The fitted curve and the error are shown in FIGS. 9A and 9B (Fit 1), respectively. FIG. 9A shows a graph of magnetic field (vertical axis) versus piston distance (horizontal axis). FIG. 9B shows a graph of error (vertical axis) versus piston distance (horizontal axis).

B. Method 2—Minimax Fitting

The previous least-squares algorithm is based on minimizing the square of the errors or the following expression: J=∥e∥ ₂ ² =e ^(T) e=(y−HX)^(T)(y−HX)  Equation XXVIII

The error in the previous case is given in the following Equation XXIX:

$e = \left( {{B_{x}x_{p - {LVDT}}} - {\left\lbrack {{- B_{x}} - \left( {x_{p - {LVDT}} - x_{{p\; 0} - {LVDT}}} \right)} \right\rbrack\begin{bmatrix} \hat{e} \\ \hat{q} \end{bmatrix}}} \right)$

However, we are interested in finding p and e that minimizes the error between the distance obtained from the AMR sensor and the distance from the LVDT sensor uniformly across the piston motion range. This is equivalent to minimizing the maximum error or minimizing the infinity norm of the errors. This problem can be written as follows:

$x_{{pi} - {AMR}} = {{{\frac{{qx}_{{p\; 0} - {LVDT}} - {B_{xi}e}}{B_{xi} + q}\mspace{14mu}\&}\mspace{14mu} q} = \frac{p}{x_{{p\; 0} - {LVDT}} + e}}$

The problem defined in Equation XXX can be rewritten by defining a new variable and transforming it into a problem with linear objective as follows:

minimize  γ ${{subject}\mspace{14mu}{to}\mspace{14mu}\left( {x_{{pi} - {LVDT}} - \frac{{q\; x_{{p\; 0} - {LVDT}}} - {B_{xi}e}}{B_{xi} + q}} \right)} \leq \gamma$ ${{and} - \left( {x_{{pi} - {LVDT}} - \frac{{qx}_{{p\; 0} - {LVDT}} - {B_{xi}e}}{B_{xi} + q}} \right)} \leq \gamma$ i = 1, 2, …  , n

Referring to FIG. 8, it can be seen that the magnetic field decreases as the piston moves from its initial position, x_(p0), and gets closer to the magnetic sensor. Hence, we should have:

${\frac{p}{x_{{p\; 0} - {LVDT}} + e} = {{q \leq {{- B_{xi}}\mspace{14mu}{for}\mspace{14mu} i}} = 1}},2,\ldots\mspace{14mu},n$

Now, the problem defined in Equation XXXI can be rewritten as follows: minimize γ subject to (γ−x _(pi-LVDT) +x _(pO-LVDT))q−B _(xi) e≤(x _(pi-LVDT)−γ)B _(xi) and (γ+x _(pi-LVDT) −x _(pO-LVDT))q+B _(xi) e≤(−x _(pi-LVDT)−γ)B _(xi) q+B _(xi)≤0q+B _(xi)≤0  Equation XXXIII

i=1, 2, . . . , n

The problem defined in Equation XXXIII can be solved iteratively using a bisection algorithm as follows:

-   -   assuming that the optimal γ is in the interval [l, u].     -   repeat solving feasibility problem for γ=(u+l)/2         (γ−x _(pi-LVDT) +x _(p0-LVDT))q−B _(xi) e≤(x _(pt-LVDT)−γ)B         _(xi)         (γ+x _(pi-LVDT) −x _(p0-LVDT))q+B _(xi) e≤(−x _(pi-LVDT)−γ)B         _(xi)         q+B _(xi)≤0

i=1, 2, . . . , n

-   -   if feasible u:=γ, if infeasible l:=γ     -   until u−l≤∈

With this method, the optimal p and e are obtained, which are presented in Table I (Method 2) above. As can be seen from Table I, the maximum error is reduced by about 20 percent compared to using the least squares method. The fitted curve and the error are shown in FIGS. 9A and 9B (Fit 2), respectively.

VI. One-Time Parameter Estimation Using Piston Stroking and Magnetic Sensors Only (Method 3)

In the previous section, the equation parameters, p and e, were obtained by fitting a curve to the magnetic field versus actual distance data points. The actual distance was obtained from the installed LVDT sensor on the FPE. However, if there is not an LVDT or other type of displacement measurement available, these methods cannot be applied. In a real-world engine on a car, no additional displacement sensor is likely to be available. In this section, a description is provided about how to use two AMR sensors only to obtain the equation parameters. With this method, one can estimate the position of the piston using AMR sensors without the need of any additional distance sensors for calibration. The two AMR sensors are aligned along the longitudinal axis of motion of the cylinder. The distance between the two sensors is d=38 mm.

We have the following equation for the two sensors:

$\quad\left\{ \begin{matrix} {{B\; 1_{x}} = {\frac{p}{x_{p} + e} - \frac{p}{x_{p\; 0} + e}}} \\ {{B\; 2_{x}} = {\frac{p}{x_{p} + e + d} - \frac{p}{x_{p\; 0} + e + d}}} \end{matrix} \right.$

Solving for x_(p) from the first equation in Equation XXXIV and replacing into the second equation in Equation XXXIV, results in the following:

$x_{p} = {\frac{p}{{B\; 1_{x}} + \frac{p}{e + x_{p\; 0}}} - e}$

${B\; 2_{x}} = {\frac{p}{d + \frac{p}{{B\; 1_{x}} + \frac{p}{e + x_{p\; 0}}}} - \frac{p}{d + e + x_{p\; 0}}}$

The above equation and the data points from the two AMR sensors can be used to obtain p and e by applying the iterated least squares method. However, it has been observed that the parameter estimates did not converge consistently in this case. In order to make the algorithm converge reliably, the measurements from the final point of the position of the piston can be included, which will be:

$\quad\left\{ \begin{matrix} {{B\; 1_{x\; f}} = {\frac{p}{x_{p\; f} + e} - \frac{p}{x_{p\; 0} + e}}} \\ {{B\; 2_{x\; f}} = {\frac{p}{x_{pf} + e + d} - \frac{p}{x_{p\; 0} + e + d}}} \end{matrix} \right.$

In general, this final point would be available only by knowing the range of motion of the piston. In other words, to use this method, one only needs to move the piston from one end to the other end, record the AMR sensors signals and know the motion range of the piston. Then, we will have the following measurements:

$\quad\left\{ {{{\begin{matrix} {{B\; 2_{xi}} = {{h_{1}\left( {{B\; 1_{x}},p,e} \right)} + v_{1\; i}}} \\ {{B\; 1_{xf}} = {{h_{2}\left( {x_{pf},p,e} \right)} + v_{2}}} \\ {{B\; 2_{xf}} = {{h_{3}\left( {x_{pf},p,e} \right)} + v_{3}}} \end{matrix}\mspace{14mu}{for}\mspace{14mu} i} = 1},2,\ldots\mspace{14mu},{{n{where}\text{:}{h_{1}\left( {{B\; 1_{x}},p,e} \right)}} = {{\frac{p}{d + \frac{p}{{B\; 1_{x}} + \frac{p}{e + x_{p\; 0}}}} - {\frac{p}{d + e + x_{p\; 0}}{h_{2}\left( {x_{pf},p,e} \right)}}} = {{\frac{p}{x_{pf} + e} - {\frac{p}{x_{p\; 0} + e}{h_{3}\left( {x_{pf},p,e} \right)}}} = {\frac{p}{x_{pf} + e + d} - \frac{p}{x_{p\; 0} + e + d}}}}}} \right.$

Here, the noise was assumed to be additive for simplicity. Now using the iterated least squares method, one can obtain p and e, which are presented in Table I (Method 3) above. The fitted curve and the error are shown in FIGS. 9A and 9B (Fit 3), respectively. It can be seen that by using only two AMR sensors without any other calibrating devices, one can get the position error to be within a maximum of 0.4 mm.

Once the equation parameters p and e are known, the distance from the AMR sensors can be calculated using Equation XXI. FIGS. 10 and 11 show results of two experiments with the FPE. FIG. 10 shows a graph of piston distance (vertical axis) versus time (horizontal axis) for AMR sensors and an LVDT sensor in a first experiment. FIG. 11 shows a graph of piston distance (vertical axis) versus time (horizontal axis) for AMR sensors and an LVDT sensor in a second experiment. In the first experiment, the FPE started running at 2 Hz and the amplitude was increased over time. In the second experiment, the FPE started running at 2 Hz and the frequency increased to 5 Hz during the test. It can be seen that in both cases, the AMR sensors provide an excellent estimate of the piston position, as verified by the LVDT sensor.

VII. Adaptive Parameter Estimation and Real-Time Position Estimation

In section VI, a method was described for estimation of the parameters in Equation XXI using two AMR sensors. In the described method (Method 3), the piston is moved from one end to the other end and the AMR sensor readings are recorded. Next, the iterated least squares method is applied to estimate the model parameters, p and e. Finally, the estimated parameters can be used along with Equation XXI or Equation XXXIV to estimate piston position. In this section, two other methods (Methods 4 and 5) are proposed for real-time estimation of both piston position, x_(p), and model parameters, p and e. An advantage of these methods is that it is not necessary to interrupt the regular operation of the engine and move the piston on a full stroke motion. The sensors along with the required electronics can be placed along the axis of the piston, and as the piston is continuing its normal operation, model parameters as well as piston position are estimated. The two algorithms are described in the following sections.

A. Method 4—Extended Kalman Filter (EKF)

As mentioned earlier, an objective of real-time position estimation is to estimate both piston position and model parameters in real-time so that it will not be necessary to interrupt the normal operation of the engine. Hence, the variables to be estimated are x_(p), p and e. Also, the two AMR sensors, placed along the longitudinal axis of motion of the cylinder, provide measurements described by Equation XXXIV. As mentioned earlier, in Equation XXXIV, x_(p0) is the piston position at time zero and B1 _(x) and B2 _(x) are the magnetic field readings at AMR sensors 1 and 2 from which the initial magnetic field has been subtracted.

Using the Extended Kalman Filter (EKF), we can measure the magnetic field from the two AMR sensors and estimate the variables. The state to be estimated is (dropping index p from x): X=[xvape]^(T)  Equation XXXIX

where x, v and a are the piston position, velocity and acceleration respectively, and p and e are the model parameters.

The system and measurement equations are as follows: X _(k) =FX _(k-1) +w _(k-1) z _(k) =h(X _(k) ,n _(k)) w _(k)˜(0,Q) n _(k)˜(0,R)  Equation XL

Where:

$F = \begin{bmatrix} 1 & {dt} & 0 & 0 & 0 \\ 0 & 1 & {dt} & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix}$ z_(k) = [B_(1 k)  B_(2 k)]^(T) ${h\left( {X_{k},n_{k}} \right)} = \begin{bmatrix} {\frac{p_{k}}{x_{k} + e_{k}} - \frac{p_{k}}{x_{0} + e_{k}} + n_{k}^{1}} \\ {\frac{p_{k}}{x_{k} + e_{k} + d} - \frac{p_{k}}{x_{0} + e_{k} + d} + n_{k}^{2}} \end{bmatrix}$

where: dt is the sampling time, and d is the distance between the two AMR sensors. Also the acceleration of the piston is assumed to be zero-mean, which is a reasonable assumption considering the alternating motion of the piston.

The time update equations are as follows: {circumflex over (X)} _(k) ⁻ =FX _(k-1) ⁺ P _(k) ⁻ =FP _(k-1) ⁺ F ^(T) +Q  Equation XLII

The measurement update equations are as follows:

K_(k) = P_(k)⁻H_(k)^(T)(H_(k)P_(k)⁻H_(k)^(T) + R)⁻¹ X̂_(k)⁺ = X̂_(k)⁻ + K_(k)(z_(k) − h(X̂_(k)⁻, 0)) P_(k)⁺ = (I − K_(k)H_(k))P_(k)⁻ where: $H_{k} = \left. \frac{\partial h}{\partial X} \right|_{{\hat{X}}_{k}^{-}}$

The method was then applied to a portion of data obtained from a test with the FPE where the piston motion has reached its steady-state behavior. The results are shown in FIGS. 12-14. FIG. 12 shows a graph of magnetic field (vertical axis) versus time (horizontal axis) measured by two AMR sensors. FIG. 13 shows a graph of piston distance (vertical axis) versus time (horizontal axis) for the position estimates obtained by method 4 in comparison to LVDT measurements. FIG. 14 shows a graph of model parameter estimates.

As can be seen in FIG. 13, it takes several cycles until the piston position estimation error reduces to a few millimeters. However, the few seconds of time taken before the sensor starts working well, is insignificant. Once a sensor is utilized for distance measurement of a particular object, it will work very accurately and reliably after the first few seconds of operation. FIG. 15 shows the estimated position of the piston when the piston is moved a full stroke length after the parameter adaptation. FIG. 16 shows the error between a Linear Variable Differential Transducer (LVDT) used as a reference and magnetic sensor estimate of piston position. It can be seen that the maximum error with respect to the LVDT reference is less than 0.4 mm.

It is possible to further improve the performance of the estimator by using the fact that the range of motion of a piston is generally known. The resulting improved estimator is described in the following section.

B. Method 5—Extended Kalman Filter (EKF)

From the geometry of the piston inside the engine and the location of the AMR sensors with respect to the engine, it is possible to know the minimum and maximum distance of the piston from the AMR sensors. In other words, the min and max of piston position, x, are known, which are synchronized with min and max of the measured magnetic field. For example, considering FIGS. 12 and 13, it can be seen that the magnetic field reading is about zero when the piston is furthest from the sensors. This is because initially, at t=0, the piston was at the furthest location from the AMR sensors and the initial magnetic field at t=0 is subtracted from the measurements. Now, when the piston comes to the closest distance to the AMR sensors, x_(f), the absolute value of the magnetic field reaches its maximum. Hence, we will have the following extra measurement at this particular instant in time:

$\quad\left\{ \begin{matrix} {{B\; 1_{xf}} = {\frac{p}{x_{f} + e} - \frac{p}{x_{0} + e} + n_{1}}} \\ {{B\; 2_{xf}} = {\frac{p}{x_{f} + e + d} - \frac{p}{x_{0} + e + d} + n_{2}}} \end{matrix} \right.$

These extra measurements can be integrated into the Extended Kalman Filter from the previous section to update p and e whenever a peak in the magnetic field has been detected. The results from the new estimator are shown in FIGS. 17 and 18. FIG. 17 shows a graph of piston distance (vertical axis) versus time (horizontal axis) for the position estimates obtained by method 5 in comparison to LVDT measurements. FIG. 18 shows a graph of model parameter estimates using method 5. As can be seen in FIG. 17, piston position estimation converges to the true position within a couple of cycles.

The position measurement approach described above for the rectangular piston position application can be generalized and applied to position measurement for a number of other objects. Several real world applications using examples of other objects of different sizes and geometries will now be described. The general position measurement system that is common to all of these applications consists of the following components: (1) A set of two magnetic field measurement sensors, separated by a known longitudinal distance between them; (2) a model of the magnetic field around the ferromagnetic object under consideration, as a function of the position around the object; (3) a method to calculate the position of the object from the magnetic field function, by measuring the magnetic field using a sensor; and (4) a method to automatically estimate the parameters of the model for the object under consideration, by use of multiple longitudinally separated redundant sensors and an adaptive estimator.

It should be noted that no external magnets are required in this position measurement system—the inherent magnetic field of the ferromagnetic object is exploited. The position measurement system has been evaluated for a number of important applications of practical real-world importance, including the following: (1) Measurement of the position of a piston inside an internal combustion engine cylinder; (2) measurement of the distances between cars in imminent collision prediction applications; and (3) measurement of the position of a circular rod inside a common commercial hydraulic cylinder. The first of these applications was described above, and the second and third applications will be described below.

The following is a description of the measurement of the distances between cars in imminent collision prediction applications. Consider the use of these sensors on a car to measure the distance and velocity to another car for detection of an impending collision. By detecting an unavoidable imminent collision just before it occurs, several occupant protection measures can be taken. These go beyond pre-tightening of seat belts and pre-inflation of air bags, to also include active enhancement of crush space inside the car, seat-back control to better position the driver with respect to the steering wheel and use of external airbags to cushion the impact of the crash. Current collision detection systems based on radar and laser sensors do not work at the sub-meter distances needed for reliable detection of imminent unavoidable collisions. Since a car can make last minute lane changes, the occurrence of a collision has to be detected with very high reliability, in order to initiate measures such as air bag inflation. Such reliable detection can occur only at sub-meter distances. Furthermore, laser and radar sensors are too expensive to distribute all around the car for such imminent collision detection applications. The magnetic sensors described herein, on the other hand, are inexpensive enough to distribute all around the vehicle.

A car is roughly rectangular in shape and hence is expected to have a magnetic field function very similar to the rectangular piston, although it is a much larger physical object. A number of tests with different vehicles were performed in order to investigate the magnetic field generated by an encountered vehicle as a function of distance. FIG. 19 shows a general schematic of the preliminary tests. A magnetic sensor and a sonar sensor were packaged on a PCB together with a microprocessor that reads the sensor signals and transmits their values to a computer.

Based on the magnetic field analysis in the previous section and based on experimental data measured from a Chevrolet Impala vehicle, it was observed that below a threshold distance, x_(th), the following relation can be used between magnetic field and distance:

$\begin{matrix} \begin{matrix} {B = {\frac{p}{x} + q}} & {x \leq x_{th}} \end{matrix} & {{Equation}\mspace{14mu}{XLV}} \end{matrix}$

where: B is the magnetic field, x is distance of the vehicle from the sensors, and p and q are vehicle dependent parameters.

FIG. 20A shows the result of fitting Equation XLV to data points. In FIG. 20A, dataset 1 is the set of data points obtained after the vehicle gets closer than a threshold distance x_(th) to the sensors. This dataset was used for curve fitting. Dataset 2 is the set of data points from the same experiment where the vehicle was further than x_(th) from the sensors and is plotted for comparison. Equation XLV was also verified by fitting to experimental data from various other vehicles, including a VW Passat, a Hyundai Elantra, and a Honda accord vehicle. The following Table II summarizes the results of the curve fitting for each experiment showing coefficient of determinacy (R²) of the fitted curve and estimated x_(th) for a number of different vehicles from different car manufacturers:

TABLE II Results from Curve Fitting Vehicle |p| B_(stat −) q R² x_(th) Chevy Impala 25.2 3.2 0.997 ~4.8 Honda Accord 28.4 −6.7 0.999 ~3.2 VW Passat 74.3 14.3 0.997 ~4.5 Hyundai Elantra 10.2 −3.2 0.999 ~3

Based on Equation XLV, knowing parameters p and q, one would be able to estimate the distance by using only one magnetic sensor. However, these parameters change from one vehicle to another vehicle and cannot be known a priori. Therefore, a challenge would be to estimate p and q accurately and quickly in real time and use them to estimate the distance of the approaching vehicle from the sensors.

To address this challenge, two AMR sensors located apart from each other by a distance d in the X-axis, as shown in FIG. 19, is again used. The approaching vehicle is assumed to be close enough to affect both AMR sensors. The use of two sensors enables the estimation of both parameters p and q. The vehicle position can then be subsequently obtained. The estimator used for obtaining vehicle position is similar to the one discussed in previous section.

Applying the estimator to data obtained from experiments, p and q can be estimated, and an estimate of distance can be obtained. To verify this, tests were performed in which the vehicle moved toward the sensors from an initial distance and sensor outputs were recorded. Then a portion of data in which, according to the sonar sensor, the vehicle was closer than x_(th) to the sensors was selected and the designed EKF estimator was applied. An example result is shown in FIG. 20B. The resulting position estimation as seen in FIG. 20B converges very well to the position measured by the sonar sensor.

The following is a description of the measurement of the position of a circular rod inside a common hydraulic cylinder. A clear change in the magnetic field is measured when the piston moves from one end to the other end. The main source of the generated magnetic field is assumed to be the metallic rod of the piston since the piston head is made of plastic.

In order to verify the proposed measurement concept, the piston was moved a full stroke and was stopped at discrete positions. Since the hydraulic cylinder is not equipped with any other sensors, a ruler was used to obtain the distance at these discrete locations. Magnetic field was measured using the magnetic sensor which was placed at about 150 mm from the piston head. FIG. 21 shows the data points.

The magnetic field along the longitudinal axis of the cylinder will have an inverse square relationship with distance, as shown by the approximation of Equation III given above. Defining x as the piston position changing from zero to the stroke length, and e as the distance from the magnetic sensor to the piston at x=0, we have: x _(A) =x+e  Equation XLVI

Hence the approximation of Equation III can be written as follows:

$\begin{matrix} {B_{x} = \frac{p}{\left( {x + e} \right)^{2}}} & {{Equation}\mspace{14mu}{XLVII}} \end{matrix}$

Since the initial magnetic field is subtracted from the measurement, Equation XLVII should be modified to the following:

$\begin{matrix} {B_{x} = {\frac{p}{\left( {x + e} \right)^{2}} - \frac{p}{\left( {x_{0} + e} \right)^{2}}}} & {{Equation}\mspace{14mu}{XLVIII}} \end{matrix}$

In order to verify the appropriateness of this model for the hydraulic cylinder application, Equation XLVIII was fit to the data obtained from the hydraulic piston. FIG. 21 shows the result. As seen from FIG. 21, there is a very good match between the experimental data and the developed model. The piston was moved from x_(p)=0 and hence, we have x₀=0. The model parameters are identified to be p=1.627×10⁷ and e=148.4 which agrees with the fact that the magnetic sensor was placed at about 148.4 mm from the piston head at x_(p)=0.

Embodiments disclosed herein can reject disturbances due to other magnetic objects in applications wherein the moving object being monitored has a non-static (e.g., oscillatory) motion. FIGS. 22A-22C show how a disturbance due to the presence of an unexpected magnetic object is detected and then rejected (compensated) by embodiments disclosed herein. FIG. 22A shows a graph of magnetic field (vertical axis) versus time (horizontal axis) when a disturbance in the magnetic field occurs. FIG. 22B shows a graph of piston position (vertical axis) versus time (horizontal axis) to show how existing techniques do not adjust for the disturbance in the magnetic field. FIG. 22C shows a graph of piston position (vertical axis) versus time (horizontal axis) to show how embodiments disclosed herein adjust for the disturbance in the magnetic field. The system is able to do such disturbance rejection due to the fact that a) It is based on a model of the magnetic field as a function of position, and b) It utilizes redundant magnetic sensors with known distances between these sensors.

The rejection of disturbances will now be described in further detail. In one embodiment, a tiny magnet is placed on the piston of a pneumatic actuator, and the magnetic field created by this magnet is modeled. Magnetic sensors located outside the actuator are then used to accurately estimate the position of the remote piston inside the actuator. A challenge in the usage of such magnetic sensors (especially at large distances) is the influence of disturbances caused by other ferromagnetic objects being brought close to the piston. External ferromagnetic objects disturb the original magnetic field function causing large errors in position estimation. This disclosure shows how the use of a quad arrangement of magnetic sensors can be used to eliminate the influence of any external magnetic disturbance. Experimental results demonstrate that sub-millimeter accuracies in position measurement can be obtained with such a system in spite of disturbances from external ferromagnetic objects.

As the sensors are estimating the piston position, any ferromagnetic object coming close to the sensors can cause a shift in sensors readings and result in less accurate position estimation. To address this issue, a method is disclosed to reject the effect of such external disturbances. This method is not just specific to magnetic sensors and this application, but also has the potential of being applied to other types of sensors in different applications.

The experimental setup used to evaluate the performance of the proposed sensing principle consists of a pneumatic actuator made of aluminum, two external magnetic sensors with a separation of 28 mm between them, a Linear variable differential transformer (LVDT) which is used as a reference position sensor for comparison, and electronics to read sensors outputs. The LVDT has a linearity of +0.25 mm and a bandwidth of 200 Hz. It is worth mentioning that the exact value of the initial distance between the sensors and piston head is obtained as one of the parameters of the sensing system. Hence, it is not required to measure this distance; rather it is automatically calibrated as one of the parameters of the sensing system.

Since the piston is made of aluminum, it does not create a change in the measured magnetic field when it is moved from one end to the other end. Hence, a small magnet is attached to the piston head as shown in FIG. 23. After adding the magnet to the piston head, changes in the magnetic field are observed with any motion of the piston. FIG. 24 shows the measured magnetic field from the two magnetic sensors as the piston moves through a full stroke. In the following discussion, a model is developed relating the magnetic field measurements to the piston position.

Considering FIG. 23, we want to obtain a mathematical relation between the magnetic field measured by the magnetic sensor “1”, B_(x), and the piston position x_(p). The sensors are about 70 mm from the piston head at the closest distance (x_(p)=0). On the other hand, the size of the magnet attached to the piston head (1 mm in thickness and 5 mm in diameter) is very small compared to this distance. Hence it is reasonable to assume that the magnetic field at the location of the magnetic sensors due to the attached magnet can be modeled as a dipole. The magnetic field of a dipole at a distance x along its axis is given by the following Equation XLIX:

$\begin{matrix} {{B_{x} = \frac{\mu_{0}m_{0}}{2\;\pi\; x^{3}}},{B_{x} = \frac{\mu_{0}m_{0}}{2\;\pi\; x^{3}}},} & {{Equation}\mspace{14mu}{XLIX}} \end{matrix}$

where: B_(x) is the magnetic field, m₀ is the dipole magnetic moment and μ₀ is the permeability of free space.

Defining e as the initial distance between the piston head and magnetic sensor “1”, x_(p) as the piston position (changing from x_(p)=0 mm to x_(p)=50 mm), and

${p = \frac{\mu_{0}m_{0}}{2\;\pi}},$ we can rewrite Equation XLIX as follows:

$\begin{matrix} {B_{x} = {\frac{p}{\left( {x_{p} + e} \right)^{3}}.}} & {{Equation}\mspace{14mu} L} \end{matrix}$

Also, since the static magnetic field is subtracted at the beginning of each test, which also includes any field created by the outer piston at its initial position x_(p0), the magnetic field measured by sensor “1” can be written as follows:

$\begin{matrix} {B_{x} = {\frac{p}{\left( {x_{p} + e} \right)^{3}} - {\frac{p}{\left( {x_{p\; 0} + e} \right)^{3}}.}}} & {{Equation}\mspace{14mu}{LI}} \end{matrix}$

Subtracting the initial magnetic field is needed in order to remove the influence of the earth's magnetic field and other static or slowly varying magnetic fields. In order to use Equation LI for position estimation, we need to know the three parameters p, e and x_(p0). However, it is not possible to estimate all three of these parameters from this equation, even if two sensors are used instead of one sensor, since the system becomes unobservable for three unknown parameters. However, the piston can be started from a known initial position (at the lower or upper bounds of motion of the piston, x_(p)=0 mm or x_(p)=Stroke Length=50 mm) for the first time and subsequently record the final position in memory to use it as the initial position for the next run. In the following discussion, a method is disclosed to estimate the model parameters. Once the model parameters are known, Equation LI can be used to estimate piston position x_(p) by measuring magnetic field B_(x).

One of the sensing algorithms discussed herein is for a rectangular piston with an inherent magnetic field and uses a linear relationship between B_(x) and 1/x_(p). With the nonmagnetic piston and the tiny magnet shown in FIG. 23, the relationship between B_(x) and 1/x_(p) is cubic. However, the same method for identification of model parameters can be used as long as we have a model relating B_(x) and x_(p). The parameter identification method is based on using two magnetic sensors and does not require any additional sensors for calibration. Consider the two magnetic sensors placed on the longitudinal axis of the cylinder as shown in FIG. 23. We will have the following equation for the two sensors:

$\begin{matrix} \left\{ {\begin{matrix} {{B\; 1_{x}} = {\frac{p}{\left( {x_{p} + e} \right)^{3}} - \frac{p}{\left( {x_{p\; 0} + e} \right)^{3}}}} \\ {{B\; 2_{x}} = {\frac{p}{\left( {x_{p} + e + d} \right)^{3}} - \frac{p}{\left( {x_{p\; 0} + e + d} \right)^{3}}}} \end{matrix},} \right. & {{Equation}\mspace{14mu}{LII}} \end{matrix}$

where: d is the distance between the two sensors which is known.

Defining

$q = \frac{p}{\left( {x_{p\; 0} + e} \right)^{3}}$ and solving for x_(p) from the first equation in Equation LII we have:

$\begin{matrix} {x_{p} = {\left( \frac{p}{{B\; 1_{x}} + q} \right)^{1/3} - {e.}}} & {{Equation}\mspace{14mu}{LIII}} \end{matrix}$

Replacing x_(p) in the second equation of Equation LII using Equation LIII, we have:

$\begin{matrix} {{B\; 2_{x}} = {\frac{p}{\left( {\left( \frac{p}{{B\; 1_{x}} + q} \right)^{1/3} + d} \right)^{3}} - {\frac{p}{\left( {x_{p\; 0} + e + d} \right)^{3}}.}}} & {{Equation}\mspace{14mu}{LIV}} \end{matrix}$

We can use Equation LIV and the data points from the two AMR sensors to obtain p and e by applying the iterated nonlinear least squares method. Besides these data points, moving the piston a full stroke length, x_(p)=x_(p0)=0 to x_(p)=x_(pf)=Stroke Length=50 mm, the following two measurements can be also adopted:

$\begin{matrix} \left\{ {\begin{matrix} {{B\; 1_{xf}} = {\frac{p}{\left( {x_{pf} + e} \right)^{3}} - \frac{p}{\left( {x_{p\; 0} + e} \right)^{3}}}} \\ {{B\; 2_{x\; f}} = {\frac{p}{\left( {x_{pf} + e + d} \right)^{3}} - \frac{p}{\left( {x_{p\; 0} + e + d} \right)^{3}}}} \end{matrix}.} \right. & {{Equation}\mspace{14mu}{LV}} \end{matrix}$

Therefore, moving the piston a full stroke, we will have N+2 measurements:

$\begin{matrix} \left\{ \begin{matrix} {{B\; 2_{x\; i}} = {{h_{1}\left( {{B\; 1_{x}},p,e} \right)} + n_{1\; i}}} & {{{{for}\mspace{14mu} i} = 1},2,\ldots\mspace{14mu},N} \\ {{B\; 1_{x\; f}} = {{h_{2}\left( {x_{pf},p,e} \right)} + n_{2}}} & \; \\ {{{B\; 2_{xf}} = {{h_{3}\left( {x_{pf},p,e} \right)} + n_{3}}},} & \; \end{matrix} \right. & {{Equation}\mspace{14mu}{LVI}} \end{matrix}$

where: function h₁ is defined by Equation LIV, and functions h₂ and h₃ are defined by Equation LV.

Here the noise is assumed to be additive for simplicity and N is the number of samples taken during the motion of the piston. Now we can use the iterated least squares method and the measurements from the two sensors, which are shown in FIG. 24, to obtain p and e. Recall that e is the initial distance between the piston head and magnetic sensors. Hence, we can get a rough initial estimate of e by guessing or using a ruler. An initial value of p can be obtained by plugging the initial value of e in either of the equations of Equation LII. The values of the estimated parameters over iterations are shown in FIG. 25. Thus, the actual values of the parameters are obtained automatically from this algorithm.

Knowing the model parameters, we can use either one of the equations in Equation LII and get an estimate of x_(p) at each time instant as shown in FIG. 26. Comparing estimated position from magnetic sensors and the LVDT, we can calculate the error in the sensing system, which is shown in FIG. 27. FIG. 27 shows that the maximum error is less than 0.4 mm. Hence, using the developed magnetic field model, two inexpensive magnetic sensors and the calibration algorithm, the position sensing system has an accuracy of 0.4 mm without the need of any other type of sensors. Also note from FIG. 25 that the initial value of e was set to half of the actual value and yet the disclosed method is able to identify the true values of the parameters.

The position measurement approach described above for piston position measurement can be generalized and applied to position measurement for a number of other objects. The general steps to be followed are described below.

A first step is to derive an analytical function relating the magnetic field around the ferrous object to distance from the object. Hence, we have: B _(x)=ƒ(x _(p),λ),  Equation LVII

where: x_(p) is the piston position, λ is a vector of parameters in the model, and B_(x) is the measured magnetic field.

The function ƒ(x_(p),λ) should be injective and invertible for x_(p), so that we can calculate the function g where: x _(p) =g(B _(x),λ)=ƒ⁻¹(B _(x),λ).  Equation LVIII

Equation LII shows an example for the function g. Note that if function ƒ is not injective and/or invertible, the methods described in section VII can be used to adaptively estimate both model parameters as well as position in real-time.

A second step is to place two magnetic sensors along the axis of motion of the object with a spacing of d. The magnetic field measured by the sensors will have the following relation with x_(p):

$\begin{matrix} \left\{ {\begin{matrix} {{B\; 1_{x}} = {f\left( {x_{p},\lambda} \right)}} \\ {{B\; 2_{x}} = {f\left( {{x_{p} + d},\lambda} \right)}} \end{matrix}.} \right. & {{Equation}\mspace{14mu}{LIX}} \end{matrix}$

Using Equation LVIII we get: B2_(x)=ƒ(g(B _(x),λ)+d,λ).  Equation LX

The significance of Equation LX is that it is not dependent on position. Model parameters can be estimated from this equation using the measurements from the two sensors. Hence, no other reference sensors are required for calibration.

A third step is to move the object a full stroke length and record sensor measurements. Using these magnetic measurements and the fact that the stroke length is known, the following measurements are available: B2_(xi)=ƒ(g(B _(xi),λ)+d,λ)+n _(1i) i=1,2, . . . ,N B1_(xƒ)=ƒ(x _(pf),λ)+n ₂ B2_(xƒ)=ƒ(x _(pf) +d,λ)+n ₃,  Equation LXI

where: N is the number of samples taken during the object motion and n is the measurement noise.

A fourth step is to apply iterated nonlinear least squares or other parameter estimation algorithms to estimate model parameters λ.

A fifth step is to use Equation LVIII to estimate piston position x_(p), by measuring the magnetic field B_(x) in real-time.

The problem of external disturbances on the magnetic sensors due to the unexpected presence of other ferromagnetic objects which cause inaccuracies in piston position estimation will now be discussed. As an example, consider FIG. 28, which shows the actual piston position as measured by the LVDT. FIG. 29 shows the signal from the magnetic sensor for the same test which gets affected by an external disturbance. The disturbance is created by bringing a ferromagnetic object (e.g., a pliers) from a far distance (with no impact on the sensor) close to the sensor. Consequently, the sensor signal starts deviating from its actual value (at t≅16 s) and reaches a final value as the object is placed next to the sensor. If the system does not correct for this disturbance, the position estimate obtained from the magnetic sensor measurements will be inaccurate as shown in FIG. 28. In this example, the error caused by the disturbance is as much as 10 mm.

In order to address disturbance rejection and provide robustness, a method is described which is based on using a quad arrangement of four magnetic sensors as shown in FIG. 30. In the description above, a mathematical model relating the magnetic field measured by the sensors “1” and “2” to piston position was developed. For the disturbance rejection algorithm, we first derive a model relating the magnetic field measured by sensors “3” and “4”, which are laterally offset from the axis of motion of the piston, to the piston position.

Considering FIG. 31, we have the following relations:

$\begin{matrix} {{B_{r} = {\frac{\mu_{0}m_{0}}{2\;\pi\; r^{3}}{\cos(\alpha)}}},} & {{Equation}\mspace{14mu}{LXII}} \end{matrix}$

$\begin{matrix} {B_{\alpha} = {\frac{\mu_{0}m_{0}}{4\;\pi\; r^{3}}{{\sin(\alpha)}.}}} & {{Equation}\mspace{14mu}{LXIII}} \end{matrix}$

Assuming that a magnetic sensor is placed at point A which measures B_(x), we will have:

$\begin{matrix} {B_{x} = {\frac{\mu_{0}m_{0}}{4\;\pi\; r^{3}}{\left( {{2\mspace{11mu}\cos^{2}\alpha} - {\sin^{2}\mspace{11mu}\alpha}} \right).}}} & {{Equation}\mspace{14mu}{LXIV}} \end{matrix}$

If we express r and a in terms of x and y, and define

${p = \frac{\mu_{0}m_{0}}{2\;\pi\; r^{3}}},$ we get:

$\begin{matrix} {B_{x} = {\frac{p\left( {{2x^{2}} - y^{2}} \right)}{2\left( {x^{2} + y^{2}} \right)^{5/2}}.}} & {{Equation}\mspace{14mu}{LXV}} \end{matrix}$

From FIG. 30, we have x=x_(p)+e and y=b. Hence:

$\begin{matrix} {B_{x} = {\frac{p\left( {{2\left( {x_{p} + e} \right)^{2}} - b^{2}} \right)}{2\left( {\left( {x_{p} + e} \right)^{2} + b^{2}} \right)^{5/2}}.}} & {{Equation}\mspace{14mu}{LXVI}} \end{matrix}$

Finally, subtracting the initial magnetic field from the sensors, we get:

$\begin{matrix} {B_{x} = {\frac{p\left( {{2\left( {x_{p} + e} \right)^{2}} - b^{2}} \right)}{2\left( {\left( {x_{p} + e} \right)^{2} + b^{2}} \right)^{5/2}} - {\frac{p\left( {{2\left( {x_{p\; 0} + e} \right)^{2}} - b^{2}} \right)}{2\left( {\left( {x_{p\; 0} + e} \right)^{2} + b^{2}} \right)^{5/2}}.}}} & {{Equation}\mspace{14mu}{LXVII}} \end{matrix}$

The model parameters in Equation LXVII are p and e which can be estimated using sensors “1” and “2” and the method described above, and b which is known (similar to d). Note that Equation LI is a special case of Equation LXVII where b=0. The algorithm used for disturbance rejection will now be described.

Considering FIG. 30, we have the following measurements from the four sensors:

$\begin{matrix} \left\{ {\begin{matrix} {{B\; 1_{x}} = {f_{1}\left( x_{p} \right)}} \\ {{B\; 2_{x}} = {{f_{2}\left( x_{p} \right)} = {f_{1}\left( {x_{p} + d} \right)}}} \\ {{B\; 3_{x}} = {f_{3}\left( x_{p} \right)}} \\ {{B\; 4_{x}} = {{f_{4}\left( x_{p} \right)} = {f_{3}\left( {x_{p} + d} \right)}}} \end{matrix},} \right. & {{Eqpuation}\mspace{14mu}{LXVIII}} \end{matrix}$

where: functions ƒ₁ and ƒ₃ are derived as Equation LI and Equation LXVII, respectively.

Now consider that a magnetic object gets close to the sensors and affects their signals. As a result, the field measured by the sensors can be expressed as:

$\begin{matrix} \left\{ {\begin{matrix} {{B\; 1_{x}} = {{f_{1}\left( x_{p} \right)} + D_{1}}} \\ {{B\; 2_{x}} = {{f_{2}\left( x_{p} \right)} + D_{2}}} \\ {{B\; 3_{x}} = {{f_{3}\left( x_{p} \right)} + D_{3}}} \\ {{B\; 4_{x}} = {{f_{4}\left( x_{p} \right)} + D_{4}}} \end{matrix}.} \right. & {{Equation}\mspace{14mu}{LXIX}} \end{matrix}$

where: the D_(i)'s represent the influence of the disturbing magnetic object on each sensor.

In general, the disturbance is unknown, and we do not have any information about the D_(i)'s. Hence, we have four equations and five unknowns, D_(i)'s and x_(p). However, it is possible to impose a constraint on D_(i)'s; since the four sensors are close to each other, we assume that we can fit a plane to the four disturbances added to the sensors. This is equivalent to the reasonable assumption that the magnetic field variation between adjacent sensors is monotonic.

A plane in 3-D space can be expressed as: z=ρ ₁ x+ρ ₂ y+ρ ₃,  Equation LXX

where: ρ_(i)'s are plane parameters.

Now, consider three points in space: (d, 0, D₂), (0, b, D₃), and (d, b, D₄). The plane which goes through these points in space can be obtained as follows:

$\begin{matrix} \left\{ {\left. \begin{matrix} {D_{2} = {{\rho_{1}d} + \rho_{3}}} \\ {D_{3} = {{\rho_{2}b} + \rho_{3}}} \\ {D_{4} = {{\rho_{1}d} + {\rho_{2}b} + \rho_{3}}} \end{matrix}\Longrightarrow\left\lbrack \begin{matrix} D_{2} \\ D_{3} \\ D_{4} \end{matrix} \right\rbrack \right. = {\left. {\begin{bmatrix} d & 0 & 1 \\ 0 & b & 1 \\ d & b & 1 \end{bmatrix}\begin{bmatrix} \rho_{1} \\ \rho_{2} \\ \rho_{3} \end{bmatrix}}\Longrightarrow\left\lbrack \begin{matrix} \rho_{1} \\ \rho_{2} \\ \rho_{3} \end{matrix} \right\rbrack \right. = {{\begin{bmatrix} d & 0 & 1 \\ 0 & b & 1 \\ d & b & 1 \end{bmatrix}^{- 1}\begin{bmatrix} D_{2} \\ D_{3} \\ D_{4} \end{bmatrix}} = {\begin{bmatrix} {{{- D_{3}}/d} + {D_{4}/d}} \\ {{{- D_{2}}/b} + {D_{4}/b}} \\ {D_{2} + D_{3} - D_{4}} \end{bmatrix}.}}}} \right. & {{Equation}\mspace{14mu}{LXXI}} \end{matrix}$

Assuming that the point (0,0, D₁) is on the same plane, we have: D ₁=ρ₁ =D ₂ +D ₃ −D ₄ ⇒D ₁ −D ₂ −D ₃ +D ₄=0.  Equation LXXII

Now, we can develop a real-time estimator to estimate piston position and the disturbances in real-time. The extended Kalman filter (EKF) was used for this purpose. The state to be estimated is: X=[x _(p) v _(p) a _(p) D ₁ D ₂ D ₃ D ₄].  Equation LXXIII

where: v_(p), a_(p) are piston velocity and acceleration, respectively.

The time update equations are:

$\begin{matrix} {\begin{matrix} {{X_{k} = {{FX}_{k - 1} + w_{k - 1}}},} & {w_{k} \sim \left( {0,Q_{k}} \right)} \\ {{{\hat{X}}_{k}^{-} = {F{\hat{X}}_{k - 1}^{+}}},} & {P_{k}^{-} = {{{FP}_{k - 1}^{+}F^{T}} + Q_{k - 1}}} \end{matrix}F = {\begin{bmatrix} 1 & {dt} & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & {dt} & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{bmatrix}.}} & {{Equation}\mspace{14mu}{LXXIV}} \end{matrix}$

The measurement update equations are:

$\begin{matrix} \begin{matrix} \begin{matrix} {{Z = {h\left( {X,n} \right)}},{Z = \left\lbrack {B\; 1_{x}\mspace{14mu} B\; 2_{x}\mspace{14mu} B\; 3_{x}\mspace{14mu} B\; 4_{x}\mspace{14mu} 0} \right\rbrack^{T}},{{h\left( {X,n} \right)} =}} \\ \left\lbrack {{f_{1}\left( x_{p} \right)} + D_{1} + {n_{1}\mspace{14mu}{f_{2}\left( x_{p} \right)}} + D_{2} + {n_{2}\mspace{14mu}\ldots\mspace{11mu}\ldots}} \right. \\ {{f_{3}\left( x_{p} \right)} + D_{3} + {n_{3}\mspace{14mu}{f_{4}\left( x_{p} \right)}} + D_{4} + {n_{4}\mspace{14mu}\ldots\mspace{11mu}\ldots}} \\ {\left. {D_{1} - D_{2} - D_{3} + D_{4} + n_{5}} \right\rbrack^{T},{n \sim \left( {0,R} \right)}} \end{matrix} \\ \begin{matrix} {R = {{diag}\left( {\left\lbrack {\sigma_{B}\mspace{20mu}\sigma_{B}\mspace{14mu}\sigma_{B}\mspace{14mu}\sigma_{B\mspace{11mu}}\;\sigma_{const}} \right\rbrack,{H_{k} = \left. \frac{\partial h}{\partial X} \right|_{{\hat{X}}_{k}^{-}}},} \right.}} \\ {{K_{k} = {P_{k}^{-}{H_{k}^{T}\left( {{H_{k}P_{k}^{-}H_{k}^{T}} + R_{k}} \right)}^{- 1}}},} \\ {{r_{k} = {Z_{k} - {h_{k}\left( {{\hat{X}}_{k}^{-},0} \right)}}},{{\hat{X}}_{k}^{+} = {{\hat{X}}_{k}^{-} + {K_{k}r_{k}}}},} \\ {P_{k}^{+} = {\left( {I - {K_{k}H_{k}}} \right){P_{k}^{-}.}}} \end{matrix} \end{matrix} & {{Equation}\mspace{14mu}{LXXV}} \end{matrix}$

Note that the imposed constraint on the disturbances D_(i)'s is included as a perfect measurement. Since at the beginning of each test, the initial magnetic field is subtracted from the sensors' readings, the estimator starts with zero disturbance. Therefore, the model uncertainty associated with disturbances, Q_(i,i) (i=4,5,6,7), is set to zero. The measurement residual r_(k) is small in this case. However, as soon as an external magnetic object creates a disturbance on the sensors readings, r_(k) will increase and when it goes over a preset threshold, Q_(i,i) (i=4, 5, 6, 7) will be set to be nonzero to allow for the estimation of the disturbances D_(i)'s.

The disturbance rejection algorithm described above was verified against several tests including the one shown in FIG. 29. The measurements from the four sensors are shown in FIG. 32, which shows how the external disturbance affects the sensors readings at t≅16 s. FIG. 33 shows piston position measured by LVDT and estimated from the magnetic sensors over time. It can be seen that the estimated position momentarily deviates from the actual position after the disturbance affects the sensors but converges to the actual value after a short period of time. FIG. 34 shows the disturbance estimation over time.

In order to investigate how fast the sensing system recovers from an external disturbance, another experiment was conducted. A coil was placed next to the sensors and a step current was sent through the wirings to create a step magnetic field disturbance on the sensors. The step disturbances have a 10%-90% rise time of 25 ms. FIG. 35 shows the measured magnetic field from the four sensors. A step current is sent through the coil at t≅15 s and removed at t≅40 s. FIG. 36 shows piston position measured by LVDT and estimated from the magnetic sensors. The error in position estimation is shown in FIG. 37. It can be seen that due to the generation and removal of the external disturbance, the error increases at t≅15 s and t≅40 s but drops very quickly (within 65 ms) below 1 mm. FIG. 38 shows the estimated disturbance on each sensor.

In general, the time it takes for the estimated disturbances to converge to the actual disturbances determines how fast the sensing system can recover from an external disturbance. This time depends on several factors including the motion of the piston. The key factors in estimation of the disturbances on each sensor are the usage of the magnetic field model of the piston and the assumed constraint between the disturbances expressed by Equation LXXII. Hence, when an external object disturbs the sensors signals, if the piston is moving, more data points would be obtained and convergence time would be faster compared to the case when the piston is stationary.

The disturbance rejection algorithm described above can be generalized and be used with a different number and configuration of sensors. The following provides a summary of the disturbance rejection method as a guideline.

As a first step, a desired number of sensors N≥2 is placed close to the object which its position is to be estimated. In the ideal case with no disturbance on the sensors, we have: Bi=ƒ _(i)(x _(p),λ) i=1,2, . . . ,N,  Equation LXXVI

where: x_(p) is the piston position, λ is a vector of parameters in the magnetic field model, and B is the measured magnetic field.

A second step is to identify the model parameters, λ_(i)'s, using the method described above.

As a third step, in general, the sensors measurement equations can be written as: Bi=ƒ _(i)(x _(p),λ)+D _(i) i=1,2, . . . ,N,  Equation LXXVI

where: D_(i)'s model the disturbance on each sensor caused by an external object.

The geometry and the location of the sensors is used to impose an M≥1 constraint on the disturbances as: c _(j)(D)=0 i=1,2, . . . ,M.  Equation LXXVIII

Equation LXXII is an example of such constraints. Two other examples are provided below.

A fourth step is to develop an estimator (such as EKF) using the measurement equations and the constraints to estimate both the position and disturbances. Note that the number of sensors N and the arrangement of the sensors depend on the specific application and the type of disturbances expected to occur. As an example, consider piston position measurement in a mobile vehicle using the proposed method where disturbances occur due to the motion and rotation of the vehicle in the Earth magnetic field. In this case, if the sensors are close to each other, we can assume that they are affected uniformly by the Earth magnetic field. Hence, we can write the constraint on the disturbances simply as: c(D)=D ₁ −D ₂=0.  Equation LXXIX

As another example, for the sensor configuration discussed above, if we also measure the magnetic field along the Y-axis of the sensors, we will have two sets of constraints:

$\begin{matrix} \left\{ \begin{matrix} {{c_{1}\left( D_{x} \right)} = {{D_{x\; 1} - D_{x\; 2} - D_{x\; 3} + D_{x\; 4}} = 0}} \\ {{c_{2}\left( D_{y} \right)} = {{D_{y\; 1} - D_{y\; 2} - D_{y\; 3} + D_{y\; 4}} = 0}} \end{matrix} \right. & {{Equation}\mspace{14mu}{LXXX}} \end{matrix}$

where: D_(xi)'s and D_(yi)'s are the disturbances on each sensor's X-axis and Y-axis measurements. Similarly, we can apply a constraint on the magnitude of the disturbances as:

$\begin{matrix} {\begin{matrix} {{c(D)} = {\left( {D_{x\; 1}^{2} + D_{y\; 1}^{2}} \right)^{0.5} - \left( {D_{x\; 2}^{2} + D_{y\; 2}^{2}} \right)^{0.5}}} \\ {{{- \left( {D_{x\; 3}^{2} + D_{y\; 3}^{2}} \right)^{0.5}} + \left( {D_{x\; 4}^{2} + D_{y\; 4}^{2}} \right)^{0.5}} = 0.} \end{matrix}} & {{Equation}\mspace{14mu}{LXXXI}} \end{matrix}$

In the following, another example for the disturbance rejection method is described and involves piston position measurement with three longitudinally spaced sensors. In this example of the disturbance rejection algorithm, three magnetic sensors are placed longitudinally along the axis of the motion of the pneumatic cylinder as shown in FIG. 39.

Following the steps described above, we write the measurement equations as:

$\begin{matrix} \left\{ \begin{matrix} {{B\; 1_{x\; f}} = {\frac{p}{\left( {x_{pf} + e} \right)^{3}} - \frac{p}{\left( {x_{p\; 0} + e} \right)^{3}}}} \\ {{B\; 2_{xf}} = {\frac{p}{\left( {x_{pf} + e + d_{12}} \right)^{3}} - \frac{p}{\left( {x_{p\; 0} + e + d_{12}} \right)^{3}}}} \\ {{B\; 3_{xf}} = {\frac{p}{\left( {x_{pf} + e + d_{13}} \right)^{3}} - \frac{p}{\left( {x_{p\; 0} + e + d_{13}} \right)^{3}}}} \end{matrix} \right. & {{Equation}\mspace{14mu}{LXXXII}} \end{matrix}$

where: d₁₂ is the distance between sensors “1” and “2”, and d₁₃ is the distance between sensors “1” and “3”. Next, we apply the method described above to identify model parameters. As a constraint on the disturbances, we assume that we can fit a line to the disturbances on the sensors. A line in 2-D plane can be expressed as: y=ρ ₁ x+ρ ₂,  Equation LXXXIII

where: ρ_(i)'s are line parameters.

Considering a line in a 2-D plane passing through the two points (d₁₂, D₂) and (d₁₃, D₃) we have:

$\begin{matrix} {\begin{matrix} \left\{ \begin{matrix} {D_{2} = {{\rho_{1}d_{12}} + \rho_{2}}} \\ {D_{3} = {{\rho_{1}d_{13}} + \rho_{2}}} \end{matrix}\Longrightarrow \right. \\ \left\{ \begin{matrix} {\rho_{1} = {\left( {D_{3} - D_{2}} \right)/\left( {d_{13} - d_{12}} \right)}} \\ {\rho_{2} = {\left( {{D_{2}d_{13}} - {D_{3}d_{12}}} \right)/\left( {d_{13} - d_{12}} \right)}} \end{matrix} \right. \end{matrix}} & {{Equation}\mspace{14mu}{LXXXIV}} \end{matrix}$

Assuming that the point (0, D₁) is on the same line and d₁₃=2d₁₂, we have: c(D)=D ₁−2D ₂ +D ₃=0  Equation LXXXV

Finally, we use the EKF to estimate both piston position as well as the disturbances on the sensors. FIGS. 40-43 show the experimental results from this sensing system where an external disturbance was created by placing a wrench close to the sensors. As seen from FIG. 41 and FIG. 43, the disturbance is partially estimated and corrected for as it is caused by the wrench. However, as the piston starts its motion, the estimated disturbances converge to the true disturbances and the estimation error reduces. Also, FIG. 42 shows that the disturbance rejection algorithm provides a great advantage compared to a sensing system without disturbance rejection where errors of up to 20 mm are observed.

As described above, a method for measuring piston position was developed using a small embedded magnet on the piston head. A nonlinear model of the magnetic field as a function of position was exploited together with auto-calibration algorithms to create a robust and accurate position measurement system. It has been shown that sub-millimeter accuracy can be achieved with the proposed position measurement system.

A challenge in using magnetic sensors for position estimation is the effect of external disturbances caused by objects moving close to the sensors. A method was disclosed to estimate and reject the external disturbance and it has been verified through experiments. This method can also be applied to other sensing systems, not necessarily magnetic based, which are affected by external disturbances.

The disturbance rejection works by taking measurements from four sensors placed in the corners of a square and assuming that it is possible to fit a plane to the disturbance caused to the four sensors. In another embodiment, three sensors are placed longitudinally and a line is fit to the disturbances on the sensors. In one form of this embodiment, a closer spacing between the sensors may be used.

In the disturbance rejection method according to one embodiment, only the measurements along the X-axis of the sensors are used. Other embodiments may include the measurements along the Y-axis as well for a higher resilience to external disturbances. The constraints that the piston position cannot decrease below zero and increase over the stroke length may also be used as constraints in the estimator.

Two-Dimensional Position Estimation: The position measurement system described herein can be extended to measurement in two-dimensions and three-dimensions. By using multi-axis magnetic field sensors and by using a matrix of sensors placed along two orthogonal axes, having both lateral and longitudinal separation of known distances, two-dimensional motion of a ferromagnetic object can be determined. The properties of auto-calibration and adaptive estimation to automatically find parameters of the magnetic field function can also be used in two-dimensional and three-dimensional applications.

An example of a ferromagnetic object that has two-dimensional motion is a car that has both lateral and longitudinal motion. The two-dimensional motion of a car can be determined by using a two-dimensional matrix of magnetic sensors with known lateral and longitudinal separations and the procedure described in this disclosure. Such a sensor system would be useful, for instance, in a car to detect the two-dimensional position of another car in close proximity to the first car.

One embodiment is directed to a position sensing system for measuring a position of a moving object. The system includes a first magnetic sensor configured to measure an intensity of a magnetic field produced by the moving object. The system includes a controller configured to estimate a position of the moving object based on a nonlinear model of the magnetic field produced by the moving object as a function of position around the moving object, and based on the measured intensity of the magnetic field produced by the moving object.

In one form of this embodiment, the nonlinear model varies based on a shape of the moving object and a strength of magnetization of the moving object. The controller is configured to subtract an initially measured magnetic field from the measured intensity of the magnetic field produced by the moving object to remove the influence of static or slowly varying magnetic fields. The first magnetic sensor is in a fixed position and does not move with the moving object. The first magnetic sensor is aligned with an axis of movement of the moving object. The controller is configured to provide a real-time indication of a current position of the moving object.

In one embodiment, the system includes a second magnetic sensor configured to measure the intensity of the magnetic field produced by the moving object, and the controller is configured to estimate the position of the moving object based on the measured intensity from the first and second magnetic sensors. In one form of this embodiment, the controller is configured to adaptively estimate parameters of the nonlinear model using magnetic field measurements from the first and second magnetic sensors. In another form of this embodiment, the controller is configured to use an iterated least squares method to adaptively estimate the parameters. In yet another form of this embodiment, the controller is configured to use a method that minimizes a maximum error to adaptively estimate the parameters. In one embodiment, the controller is configured to adaptively estimate the parameters based on a known distance between the first and second magnetic sensors and a known minimum and maximum distance of the moving object from the first and second magnetic sensors. In one embodiment, the controller is configured to use an Extended Kalman Filter (EKF) to adaptively estimate the parameters. The controller is configured to periodically update the parameters of the nonlinear model during operation of the system.

In one embodiment, the system includes a plurality of magnetic sensors, which include the first magnetic sensor, configured to measure the intensity of the magnetic field produced by the moving object, and the controller is configured to automatically compensate for unexpected magnetic field disturbances in the measured intensity of the magnetic field. In one form of this embodiment, the controller is configured to impose at least one constraint on the disturbances based on a geometry and location of the plurality of magnetic sensors, and the controller is configured to use the nonlinear model and the at least one constraint to estimate the disturbances.

Another embodiment is directed to a method of measuring a position of a moving object. The method includes measuring an intensity of a magnetic field produced by the moving object with at least one magnetic sensor, and estimating a position of the moving object based on a nonlinear model of the magnetic field produced by the moving object as a function of position around the moving object, and based on the measured intensity of the magnetic field produced by the moving object.

In one form of this embodiment, the nonlinear model varies based on a shape of the moving object and a strength of magnetization of the moving object. In one embodiment, the method further includes adaptively estimating parameters of the nonlinear model using magnetic field measurements from the at least one magnetic sensor. In another embodiment, the method further includes automatically compensating for unexpected magnetic field disturbances in the measured intensity of the magnetic field based on a geometry and location of the at least one magnetic sensor.

Yet another embodiment is directed to a position sensing system for measuring a position of a moving object. The system includes a plurality of magnetic sensors configured to perform magnetic field measurements of a magnetic field produced by the moving object. The system includes a controller configured to adaptively estimate parameters of a nonlinear model of the magnetic field produced by the moving object as a function of position around the moving object using the magnetic field measurements, and estimate a position of the moving object based on the nonlinear model and the magnetic field measurements.

VIII. Conclusion

One embodiment is directed to a sensor for the non-intrusive real-time measurement of piston position inside a cylinder. The sensor according to one embodiment utilizes external magnetic field measurements and does not require sensor placements inside the cylinder. By modeling the magnetic characteristics of the piston, a model of the magnetic field as a function of longitudinal position was obtained. Using magnetic field sensors, the piston position is obtained from the magnetic field measurements. Although some embodiments are described in the context of one dimensional position sensing, it will be understood that the techniques described herein may also be applied to two-dimensional or three-dimensional position sensing.

A challenge arises from the fact that the parameters of the model would vary from engine to engine and would be cumbersome to calibrate for each engine. This challenge is addressed in one embodiment by utilizing two magnetic field sensors with known longitudinal separation between them. By using a redundant magnetic sensor, the need to calibrate and to use an additional position sensor (such as an LVDT) for calibration was eliminated. A number of estimation methods were described, which identify and update magnetic field parameters in real-time without requiring an additional LVDT sensor for calibration. Experimental results from a free piston engine test configuration showed that the sensor can provide better than 0.4 mm accuracy in position estimates. The sensing system can be utilized for piston position measurement in multi-cylinder SI and diesel engines, hydraulic cylinders and in many other position measurement applications.

Unlike other systems that utilize magnets to detect whether a particular position is being crossed (i.e., position “detection” rather than position “measurement”), the embodiments disclosed herein include a method to continuously measure position during motion. Second, no external magnets are required—the inherent magnetic field of the ferromagnetic object is used. Third, the system auto-calibrates adaptively using the redundant magnetic sensors in the matrix of sensors.

Potentiometers, linear variable differential transformers (LVDTs), lasers, and LED based systems may be used for position measurement. In general, the LVDT and potentiometer type of sensors require a mechanical connection between the moving object and the sensor. Hence, it is not possible to use these sensors in a case where the moving object is isolated, such as a piston moving inside the engine. Making the mechanical connection requires modification of the design of the system, requires assembly, and can expose the sensors to a harsh environment where their performance reduces. Another limitation of these types of sensors is that the size of the sensor increases as the range of measurement increases.

Embodiments disclosed herein are less expensive than a potentiometer, which is the least expensive of the sensor systems listed above. Embodiments disclosed herein are also non-contacting, less noisy, and much more accurate than a potentiometer. Compared to the LVDT, embodiments disclosed herein have the advantage of being non-contacting and being an external sensor. An LVDT would have to be installed between a moving piston and a non-moving reference to provide measurements. Installing an LVDT inside a piston cylinder would be highly time-consuming. Embodiments disclosed herein can measure piston position without requiring installation inside the cylinder.

Laser and LED sensors do not require mechanical connection. However, they require a clear line of sight to the moving object. Hence, their application becomes limited in cases where the moving object is isolated. Another requirement of the sensor is that the surface of the moving object should reflect a certain percentage of the laser beam. Compared to the laser and LED based position measurement systems, embodiments disclosed herein are an order of magnitude cheaper. Laser and LEDs that provide sub-mm level accuracy are highly expensive. Embodiments disclosed herein do not require a clear line of sight to the moving object and are not dependent on the reflective properties of the moving object.

Some position measurement systems that are based on magnetic fields only provide a binary measurement of position (e.g., an indication of whether the piston is to the left or the right of the sensor), and do not provide a continuous measurement of position like embodiments disclosed herein. The inherent magnetic fields of ferromagnetic objects have been exploited for binary sensing (detection) of objects. For example, magnetic sensors embedded in highway lanes have been used to detect passing cars and to count the number of cars that travel over a sensor. Likewise, such sensors have also been used to detect the presence of a parked car in a parking spot. Note that both of the above applications only detect the presence of a vehicle and do not measure the distance to the vehicle from the sensor.

Some position measurement systems that are based on magnetic fields require installation of an extra magnet on the moving object, and an array of AMR devices is placed adjacent to the moving object. In such a system, the required short gap (i.e., 0.5 mm to 5.5 mm) between the sensor and the moving object limits the applicability of the sensor in cases where a thicker isolation of the moving object is required. Another major drawback of such a system is that the size of the sensor increases with the increase in the range of measurement of the sensor. For example, if it is desired to measure the position of a hydraulic piston whose range of motion is 500 mm, the length of the sensor should be at least 500 mm. The accuracy of magnetic sensors can be adversely affected by external magnetic objects coming close to the sensors.

In some systems, the size of the magnets attached to the moving object are different based on the desired range of motion, and can be as large as 20 mm in diameter and 7 mm in thickness, limiting the placement of magnets in a moving piston in an engine or a hydraulic cylinder. Some of these systems also have poor linearity. In contrast, embodiments disclosed herein do not have these drawbacks. Embodiments disclosed herein do not scale with the displacement being measured. Even with a small sensor footprint, embodiments disclosed herein can measure large displacements (e.g., 3 meters or more). Specific embodiments provide a 1% linearity across a 3 meter range.

Hall-effect and eddy current sensors are used in the modern industrial world for distance measurement and utilize either permanent magnets or electromagnets for their operation. They are only able to measure position at very small distances (typically less than 1 cm) between the magnet and the sensor. Embodiments of the position measurement system disclosed herein differ fundamentally from both of the above sensors because it seeks to exploit the inherent magnetic fields of ferromagnetic objects, without requiring the use of any electromagnets or permanent magnets. Neither line of sight nor close proximity between sensor and object are required for this measurement system. The position measurement system can work at distances that are two orders of magnitude larger. Since no permanent magnet or electromagnet is required, no installation is required inside the object whose position needs to be measured.

Since embodiments disclosed herein use a nonlinear model of the magnetic field of the object, the embodiments can function over a very large range and the sensors do not need to be very close to the object being measured. The range achieved by embodiments disclosed herein exceeds the range achieved by prior sensors. Another advantage provided by embodiments disclosed herein is the adaptive auto-calibration based on the magnetic function model. This provides robust performance in the presence of external magnetic fields as well as in the presence of inaccurate or unknown magnetic parameters of the individual ferromagnetic object. In one embodiment, the system is configured to perform temporal filtering to remove changes in the measured magnetic field due to outside interference (e.g., introduction of a nearby ferrous object).

Although the present invention has been described with reference to preferred embodiments, workers skilled in the art will recognize that changes can be made in form and detail without departing from the spirit and scope of the present invention. 

What is claimed is:
 1. A position sensing system for measuring a position of a moving object, comprising: first and second magnetic sensors configured to measure an intensity of a magnetic field produced by the moving object, wherein the first magnetic sensor is located at a known distance from the second magnetic sensor; a memory storing a nonlinear model of the magnetic field produced by the moving object as a function of position around the moving object; and a controller with an auto-calibration system configured to use an expected relationship between signals of the first and second magnetic sensors to automatically calibrate parameters of the nonlinear model and compute the position of the moving object.
 2. The position sensing system of claim 1, wherein the moving object is positioned inside a machine, and wherein the first and second magnetic sensors are positioned on a static portion of the machine outside of moving object.
 3. The position sensing system of claim 1, wherein the moving object comprises a piston inside a cylinder, and wherein the first and second magnetic sensors are positioned on an outside surface of the cylinder or outside the cylinder.
 4. The position sensing system of claim 1, wherein the moving object comprises a rotating object inside a machine, and wherein the first and second magnetic sensors are positioned on a static portion of the machine outside the rotating object.
 5. The position sensing system of claim 1, wherein the nonlinear model varies based on a shape of the moving object and a strength of magnetization of the moving object.
 6. The position sensing system of claim 1, wherein the controller is configured to subtract an initially measured magnetic field from the measured intensity of the magnetic field produced by the moving object to remove an influence of static or slowly varying magnetic fields.
 7. The position sensing system of claim 1, wherein the first and second magnetic sensors are in a fixed position and do not move with the moving object.
 8. The position sensing system of claim 1, wherein the controller is configured to provide a real-time indication of a current position of the moving object.
 9. The position sensing system of claim 1, and further comprising: at least one additional magnetic sensor configured to measure an intensity of the magnetic field produced by the moving object, wherein the at least one additional magnetic sensor is located at a fixed distance from the first and second magnetic sensors, and wherein the controller with the auto-calibration system is configured to use an expected relationship between signals of the first and second magnetic sensors and the at least one additional magnetic sensor to automatically calibrate parameters of the nonlinear model and compute the position of the moving object.
 10. The position sensing system of claim 1, wherein the controller is configured to adaptively estimate the parameters of the nonlinear model using magnetic field measurements from the first and second magnetic sensors.
 11. The position sensing system of claim 10, wherein the controller is configured to adaptively estimate the parameters based on the known distance between the first and second magnetic sensors and a known minimum and maximum distance of the moving object from the first and second magnetic sensors.
 12. The position sensing system of claim 10, wherein the controller is configured to use one of a deterministic nonlinear observer and a stochastic filter to adaptively estimate the parameters of the nonlinear model.
 13. The position sensing system of claim 10, wherein the controller is configured to use an iterated least squares method to adaptively estimate the parameters of the nonlinear model.
 14. The position sensing system of claim 1, wherein the controller is configured to periodically update the parameters of the nonlinear model during operation of the system.
 15. The position sensing system of claim 1, wherein the controller is configured to automatically compensate for unexpected magnetic field disturbances in the measured intensity of the magnetic field produced by the moving object.
 16. The position sensing system of claim 15, wherein additional magnetic sensors located at known distances from the first and second magnetic sensors are used to estimate and compensate for the unexpected magnetic field disturbances.
 17. The position sensing system of claim 15, wherein the controller is configured to impose at least one constraint on disturbance components read by the magnetic sensors based on a geometry and location of the magnetic sensors, and wherein the controller is configured to use the nonlinear model and the at least one constraint to estimate the disturbances.
 18. A method of measuring a position of a moving object, comprising: measuring an intensity of a magnetic field produced by the moving object with at least one magnetic sensor; estimating, with a controller, a position of the moving object based on a nonlinear model of the magnetic field produced by the moving object as a function of position around the moving object, and based on the measured intensity of the magnetic field produced by the moving object; and automatically compensating, with the controller, for unexpected magnetic field disturbances in the measured intensity of the magnetic field based on a geometry and location of the at least one magnetic sensor.
 19. The method of claim 18, wherein the moving object is positioned inside a machine, and wherein the first and second magnetic sensors are positioned on a static portion of the machine outside the moving object.
 20. The method of claim 18, wherein the nonlinear model varies based on a shape of the moving object and a strength of magnetization of the moving object.
 21. The method of claim 18, and further comprising: adaptively estimating parameters of the nonlinear model using magnetic field measurements from the at least one magnetic sensor.
 22. A position sensing system for measuring a position of a moving object moving inside of a machine, comprising: a plurality of magnetic sensors positioned outside of the object on a static portion of the machine and configured to perform magnetic field measurements of a magnetic field produced by the moving object; and a controller communicatively coupled to the plurality of magnetic sensors and configured to adaptively estimate parameters of a nonlinear model of the magnetic field as a function of position around the moving object using the magnetic field measurements and a known distance between the magnetic sensors, and estimate a position of the moving object based on the nonlinear model and the magnetic field measurements.
 23. The position sensing system of claim 22, wherein the controller is configured to automatically compensate for unexpected magnetic field disturbances in the magnetic field measurements based on a geometry and location of the magnetic sensors. 